﻿using Crevice2D.Core.Managers;
using Microsoft.Xna.Framework;

namespace Crevice2D.Core.Data
{
    public abstract class AnimatedObject : BaseObject
    {
        protected Animation _animation;
        protected string _animationPath;

        public int AnimationWidth { get { return _animation.FrameWidth; } }
        public int AnimationHeight { get { return _animation.FrameHeight; } }

        protected AnimatedObject() { }

        public virtual bool LoadContent() { return true; }

        public virtual void Update(GameTime gameTime)
        {
            _animation.Position = Position;
            _animation.Update(gameTime);
            base.Update(gameTime);
        }

        public virtual void Draw(GameTime gameTime)
        {
            _animation.Draw(RenderManager.SpriteBatch);
            base.Draw(gameTime);
        }
    }
}
